<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header"></head>

<!--<link th:href="@{/ajax/libs/webuploader/webuploader.css}" rel="stylesheet"/>
<link th:href="@{/css/demo/webuploader-demo.css}" rel="stylesheet"/>
<link th:href="@{/css/style.css}" rel="stylesheet"/>-->
<link th:href="@{/css/plugins/dropzone/basic.css}" rel="stylesheet"/>
<link th:href="@{/css/plugins/dropzone/dropzone.css}" rel="stylesheet"/>
<link th:href="@{/css/style.css?v=4.1.0}" rel="stylesheet">
<body class="white-bg">
<div class="ibox-content">
    <form action="" method="post" class="form-horizontal m" id="form-ordersDetail-batchDeleteRemark" >
        <div class="" th:each="id:${ids}" >
            <div class="select_id" th:text="${id}" style="display: none"></div>
        </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">Reasons for deletion：</label>
                <div class="select-list col-sm-9">
                    <ul>
                        <li>
                            <select id="deleteReason" class="reset_select">
                                <option value="已无剩余库存">已无剩余库存</option>
                                <option value="找不到了">找不到了</option>
                                <option value="已损坏">已损坏</option>
                                <option value="废单">废单</option>
                            </select>
                        </li>
                    </ul>
                </div>
            </div>


            <div class="form-group" style="margin-top: 50px">
                <div class="col-sm-12 col-sm-offset-3">
                    <button type="submit" class="btn btn-primary" data-loading-text="Loading..." >submit</button><!--  onclick="upload()" -->
                    <button onclick="$.modal.close()" class="btn btn-danger" type="button">close</button>
                </div>
            </div>
        </div>

    </form>

</div>

<div th:include="include::footer"></div>
<script type="text/javascript">
    //提交删除备注
    $("#form-ordersDetail-batchDeleteRemark").validate({
        submitHandler: function(form) {
            var ids = [];//选中行的id数组
            $(".select_id").each(function () {
                ids.push($(this).text());
            })
            $.ajax({
                async : true,
                cache : true,
                dataType: 'json',
                url : ctx+"module/ordersDetail/batchDeleteRemark",
                type : "POST",
                data : {
                    ids:ids,
                    bz:$("#deleteReason").val(),
                    isDel:1,
                },
                error : function(request) {
                    $.modal.alertError("system error");
                },
                success : function(data) {
                    $.operate.saveSuccess(data);
                },complete: function(XMLHttpRequest, textStatus) {
                }
            });
        }
    });

</script>
</body>
</html>
